import http from '../utils/axios';

import { Authority } from '@/interface/index';

export const getRoleListApi = () =>
  http.get<Authority.RoleList>('/api/permission/getRoles');

export const editRoleApi = (data: any) =>
  http.post<any>('/api/permission/addOrUpdateRole', data);
export const addRoleApi = (data: any) =>
  http.post<any>('/api/permission/addOrUpdateRole', data);
export const delRoleApi = (data: any) =>
  http.post<any>('/api/permission/delRoles', data);
export const changeRoleStateApi = (data: any) =>
  http.post<any>('/api/permission/updateState', data);

export const getMemberListApi = (data = {}) =>
  http.post<any>('/api/permission/getMember', data);

export const getRoleSelectApi = () =>
  http.get<any>('/api/permission/getRoleNames');

export const getAddMemberApi = (data = {}) =>
  http.post<any>('/api/permission/addEmpl', data);
export const getEditMemberApi = (data = {}) =>
  http.post<any>('/api/permission/addEmpl', data);
export const getDelMemberApi = (data = {}) =>
  http.post<any>('/api/permission/delEmpls', data);
